﻿using HuaHan.WorkTicket.Domain.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuaHan.WorkTicket.Domain.Repositories.EntityFramework.ModelConfigurations
{
    public abstract class BaseConfiguration<T>  : EntityTypeConfiguration<T> where T:BaseEntity
    {
        public BaseConfiguration()
        {

            this.Property(c => c.IsValid)
                .IsRequired();
            this.Property(c => c.IsDeleted)
                .IsRequired();
            this.Property(c => c.Remark)
                .HasMaxLength(100);

            this.Property(c => c.CreatedAt)
                .IsRequired();
            this.Property(c => c.CreatedBy)
                .HasMaxLength(30);
            this.Property(c => c.UpdatedAt)
                .IsRequired();
            this.Property(c => c.UpdatedBy)
                .HasMaxLength(30);

        }
    }
}
